<#import "/spring.ftl" as spring/>
<tr class="none">
<td class="tab-cz" onclick="removeFun(this)"><img src="/ls-erp/static/images/del_icon.png" class="delBtn"></td>
<td class="tab-mfltp"></td>
<td class="tab-mfltp"></td>
<td class="tab-wlup"></td>
<td class="tab-mflkz"></td>
<td class="tab-mflcf"></td>
<td class="tab-mflzsmd"></td>
<td class="tab-mflfg"></td>
<td class="tab-jjnf"></td>
<td class="tab-mflzf"></td>
<td class="tab-mflsybw">
<select style="width: 145px ;border:1px solid #acacac" name="" multiple="multiple" >
			<#list itemList as item>
			    <option value="${item.itemCode}-${item.itemValue}" >${item.itemName}</option>
			</#list>
			</select>
</td>
<td class="tab-mfldh"></td>
<td class="tabwrite-mfldh" id = "materialUnit"></td>
<td class="tabwrite-bz" id = "materialRemarks"></td>
<td style="display:none;"></td>
</tr>
<#list cgMaterialList as cgList>
<#if cgList??&&(cgList?size > 0) >
								<tr class="">
									<td class="tab-cz" onclick="removeFun(this)"><img src="/ls-erp/static/images/del_icon.png" class="delBtn"></td>
									<td class="tab-mfltp"><#if cgList.cgMaterialTypeCd??>${dict.getDictName(cgList.cgMaterialTypeCd)}</#if></td>
									<td>
	<#if cgList.cgMaterialFilePath?exists&cgList.cgMaterialFilePath!=''>  
	    <p class="tab-mfltp"><img src='${cgList.cgMaterialFilePath}${cgList.cgMaterialFileName}'></p>
	<#else>  
	    <p class="tab-mfltp"><img src="/ls-erp/static/images/pic-none.jpg"></p>
	</#if>
									</td>
									<td class="tab-wlup"><#if cgList.cgMaterialNameCn??>${cgList.cgMaterialNameCn}</#if><br><#if cgList.cgGaterialCd??>${cgList.cgGaterialCd}</#if></td>
									<td class="tab-mflkz"><#if cgList.materialgramWeight??>${cgList.materialgramWeight}</#if></td>
									<td class="tab-mflcf"><#if cgList.cgMaterialComposition??>${cgList.cgMaterialComposition}</#if></td>
									<td class="tab-mflzsmd"><#if cgList.materialThreadCount??>${cgList.materialThreadCount}</#if></td>
									<td class="tab-mflfg"><#if cgList.materialStyle??>${dict.getDictName(cgList.materialStyle)}</#if></td>
									<td class="tab-jjnf"><#if cgList.cgMaterialColor??>${cgList.cgMaterialColor}</#if></td>
									<td class="tab-mflzf"><#if cgList.materialWeave??>${dict.getDictName(cgList.materialWeave)}</#if></td>
									<td class="tab-mflsybw">
										 <div id="tdTemp${cgList_index}">
										  <#if cgList.cgMaterialPlacement??>
             <#list cgList.cgMaterialPlacement?split(",") as placementItems>
             ${dict.getDictName(placementItems)}<br>
             </#list>
        </#if>
        
        </div>
										<div id="selectTemp${cgList_index}">
        <#if cgList.cgMaterialPlacement??>
        <#assign flg = "0">
        <select style="width: 145px ;border:1px solid #acacac" id="mpt${cgList_index}" name="changeMaterial.cgMatList[tempIndex].cgMaterialPlacement" multiple="multiple" >
            <#list itemList as item>
                <#assign flg = "0">
                <#list cgList.cgMaterialPlacement?split(",") as placementItems>
                <#if placementItems== (item.itemCode + "-" + item.itemValue)>
                    <option value="${item.itemCode}-${item.itemValue}" selected="selected">${item.itemName}</option>
                    <#assign flg = "1">
                    <#break>
                </#if>
                </#list>
                <#if flg=="0" >
                    <option value="${item.itemCode}-${item.itemValue}" >${item.itemName}</option>
                </#if>
            </#list>
        </select>
        <#else>
        <select style="width: 145px ;border:1px solid #acacac" id="mpt${cgList_index}" name="" multiple="multiple" >
			<#list itemList as item>
			    <option value="${item.itemCode}-${item.itemValue}" >${item.itemName}</option>
			</#list>
			</select>
        </#if>
        </div>

									</td>
									<td class="tab-mfldh"><#if cgList.materialQuantity??>${cgList.materialQuantity}</#if></td>
									<td class="tabwrite-mfldh" id = "materialUnit"><#if cgList.materialLoss??>${cgList.materialLoss}</#if></td>
									<td class="tabwrite-bz" id = "materialRemarks"><#if cgList.cgMaterialRemarks??>${cgList.cgMaterialRemarks}</#if></td>
									<td style="display:none;">
        <input type='hidden' class = 'materialRemarks' name='changeMaterial.cgMatList[tempIndex].cgMaterialRemarks' value="<#if cgList.cgMaterialRemarks??>${cgList.cgMaterialRemarks}</#if>"/>
        <input type='hidden' class = 'materialUnit' name='changeMaterial.cgMatList[tempIndex].materialLoss' value="<#if cgList.materialLoss??>${cgList.materialLoss?c}</#if>"/>
        <input type='hidden' name='changeMaterial.cgMatList[tempIndex].cgMaterialStageCd' value='AUDIT_PHASE_CD-PHASE_CD_20'/>
        <input type='hidden' name='changeMaterial.cgMatList[tempIndex].materialUnitPrice' value='<#if cgList.cgMaterialId??>${cgList.materialUnitPrice}</#if>'/>
        <input type='hidden' name='changeMaterial.cgMatList[tempIndex].cgMaterialId' value='<#if cgList.cgMaterialId??>${cgList.cgMaterialId}</#if>'/>
	</td>
								</tr>
					</#if>
</#list>
